package com.example.front.main.home;

import android.content.Intent;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

import com.bumptech.glide.Glide;
import com.example.front.R;

public class SwitchGameIntroductionActivity extends AppCompatActivity {
    private TextView name_textView;
    private TextView score_textView;
    private TextView type_textView;
    private TextView yuyan_textView;
    private TextView introduction_textView;
    private ImageView imageView;

    @Override
    protected void onCreate(Bundle savedInstanceState){
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_switch_introduction);
        name_textView = findViewById(R.id.name_textView);
        type_textView = findViewById(R.id.type_textView);
        yuyan_textView = findViewById(R.id.yuyan_textView);
        introduction_textView = findViewById(R.id.introduction_textView);
        imageView = findViewById(R.id.switchGame_imageView);
        Intent intent = getIntent();
        Bundle bundle = intent.getExtras();
        String name = bundle.getString("name", "");
        double score = bundle.getDouble("score", 0);
        String type =  bundle.getString("type", "");
        String yuyan = bundle.getString("yuyan", "");
        String introduction = bundle.getString("introduction", "");
        String photo = bundle.getString("imageUrl", "");
        name_textView.setText(name);
        type_textView.setText(type);
        yuyan_textView.setText(yuyan);
        if(introduction.equals("null"))introduction_textView.setText("  暂无介绍");
        else introduction_textView.setText("  " + introduction);
        Glide.with(SwitchGameIntroductionActivity.this)
                .load(photo)
                .placeholder(R.drawable.loading)
                .error(R.drawable.error)
                .crossFade()
                .into(imageView);
    }
}
